#include <gtest/gtest.h>

#include <memory>

class Obj {
public:
  Obj(){
    std::cout <<"Obj ctor" << std::endl;
  }
  ~Obj(){
    std::cout <<"Obj dtor" <<std::endl;
  }

  Obj(const Obj & other) = delete;
  Obj(Obj && other) = delete;

  Obj & operator =(const Obj & other) = delete;
  Obj & operator =(Obj && other) = delete;

};

std::unique_ptr<Obj> createU(){
  return std::make_unique<Obj>();
}

TEST(TestUniquePtr, test){
  {
    std::unique_ptr<int> p = std::make_unique<int>(1);
    std::cout << *p << std::endl;
  }

  {
    std::unique_ptr<Obj> p;
    ASSERT_TRUE(p == nullptr);
    p = createU();
  }

}
